<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="com.lmpop.trade.ti_brand.*" %>
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page" />  
<%
  Hashtable bMap = new Hashtable();  
  String s_title = "",s_cust="",class_attr="";
  if(request.getParameter("s_title")!=null && !request.getParameter("s_title").equals("")){
	    s_title = request.getParameter("s_title");
			bMap.put("s_title",s_title);
	}
  if(request.getParameter("s_cust")!=null && !request.getParameter("s_cust").equals("")){
	    s_cust = request.getParameter("s_cust");
		  bMap.put("s_cust",s_cust);
	}
  if(request.getParameter("class_attr")!=null && !request.getParameter("class_attr").equals("")){
	     class_attr = request.getParameter("class_attr");
		   bMap.put("class_attr",class_attr);
	}
	String s_cust_id = "";	
	if( session.getAttribute("session_cust_id") != null ){
		s_cust_id = session.getAttribute("session_cust_id").toString();
	}
	 
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");  
  String para =	"/program/admin/brand/index.jsp?s_title="+s_title+"&s_cust="+s_cust+"&class_attr="+class_attr+"&iStart="+Integer.parseInt(iStart)+"&limit="+limit;
                                           
    Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
    String select = ts_categoryInfo.getSelCatByTLevel("2", "1");
   
    String info_id="";
  	
  	if(request.getParameter("info_id")!=null) info_id = request.getParameter("info_id");
  	
  	Ti_brandInfo ti_brandInfo = new Ti_brandInfo();
  	List list = ti_brandInfo.getListByPk(info_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	String cust_id="",class_id_group="",title="",content="",site_url="",sort_no="",is_show="",in_date="",user_id="",pyKey="",is_platform="1";
  	if(map.get("class_id_group")!=null) class_id_group = map.get("class_id_group").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("content")!=null) content = map.get("content").toString();
  	if(map.get("site_url")!=null) site_url = map.get("site_url").toString();
  	if(map.get("sort_no")!=null) sort_no = map.get("sort_no").toString();
  	if(map.get("is_show")!=null) is_show = map.get("is_show").toString();
  	if(map.get("pyKey")!=null) pyKey = map.get("pyKey").toString();
  	
  	if (cust_id.equals(s_cust_id)) is_platform = "0";
     String  className1="",className2 ="",className3="";
    String classAttr[] = class_id_group.split("\\|");
    if(classAttr.length>=1 && !classAttr[0].equals("")){className1 = ts_categoryInfo.getCatNameById(classAttr[0]); } 
    if(classAttr.length>=2 && !classAttr[1].equals("")){className2= "&nbsp; &gt; " +ts_categoryInfo.getCatNameById(classAttr[1])+ "&nbsp;"; } 
    if(classAttr.length>=3 && !classAttr[2].equals("")){className3= "&nbsp; &gt; " +ts_categoryInfo.getCatNameById(classAttr[2])+ "&nbsp;"; } 
    
                                                                                                                     
%>
<html>
  <head>
    <title>ti_brand Manager</title>
	  <link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
    <script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
		<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
		<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script>   
    <script type="text/javascript" src="js_brand.js"></script> 
    <script type="text/javascript" src="/program/admin/js/judgment.js" charset="UTF-8"></script> 
</head>

<body>
	
	<h1>修改品牌</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="1" cellspacing="1" border="0" class="listtab">
				
		
		<tr>
			<td align="right" width="20%">
				品牌名称<font color="red">*</font>			
			</td>
			<td  width="80%"><input name="title" id="title" type="text" maxlength="90" value ="<%=title%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
		</tr>
      
 
		<tr>
			<td align="right" width="20%" valign="top">
				所属分类<font color="red">*</font>				
			</td>
			<td  width="80%" colspan="3">
									<select name="sort1" id="sort1" size="8" style="width:100px" onChange="setSecondClass(this.value);" onclick="setTypeName1(this)">
									   <%=select%>
									</select>
									<select name="sort2" id="sort2"  size="8" style="width:100px;display:none" onChange="setTherdClass(this.value);" onclick="setTypeName2(this)">
										<option value="">请选择...</option>
									</select>
									<select name="sort3" id="sort3"  size="8" style="width:100px;display:none" onclick="setTypeName3(this)" >
										<option value="">请选择...</option>
									</select>
				</td>
		</tr>
      
   <tr>
				<td colspan="2"   style="background:#FFDBAB;">
				<table width="100%" border="0" cellspacing="0" cellpadding="0"  style="background:#FFDBAB;">
							<tr>
								<td width="19%" height="25" align="right"  style="background:#FFDBAB;">
									<input type="hidden" name="class_id1" id="class_id1" value="">
									<input type="hidden" name="class_id2" id="class_id2" value="">
									<input type="hidden" name="class_id3" id="class_id3" value="">	 
									<input type="hidden" name="class_id_group" id="class_id_group" value="<%=class_id_group%>"/>
								  	<span style="font-size:12px;"> 您当前选择的是:</span>
								</td>
								<td align="left"   style="background:#FFDBAB;">
										
										<label id="name1" style="color:#FF7300;"><%=className1%></label>
										<label id="name2" style="color:#FF7300;"><%=className2%></label>
										<label id="name3" style="color:#FF7300;"><%=className3%></label> 
								</td>
							</tr>
						</table>
			
			</td>
		</tr>
     
    <tr>
			<td align="right" width="20%">
				品牌缩略图:		
			</td>
			<td  width="80%">
				<jsp:include page="/program/inc/uploadImgInc.jsp">
					 <jsp:param name="attach_root_id" value="<%=info_id%>" />
				</jsp:include>
			
			</td>
		</tr>
   
		<tr>
			<td align="right" width="10%">
				官网地址<font color="red">*</font>			
			</td>
			<td><input name="site_url" id="site_url" type="text" maxlength="50" value="<%=site_url%>" onkeyup="inputNoHorns(this)"   onbeforepaste= "inputNoHorns(this); "/></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				显示顺序:			</td>
			<td>
				
 <input name="sort_no" id="sort_no" type="text" onKeyUp="if(!/^[0-9][0-9]*$/.test(this.value))this.value=''" value="<%=sort_no%>" maxlength="4" size="8"/>
		<font color="#666666">(必须为数字)</font>		
			</td>
		</tr>
		
			<tr>
			<td align="right" width="20%">
				检索字母:
			</td>
			<td  width="80%">
				
 <input name="pyKey" id="pyKey" type="text" onKeyUp="if(!/^[A-Z]*$/.test(this.value))this.value='A'" value="<%=pyKey %>" maxlength="1" size="4"/>
		<font color="#666666">(请输入A-Z之间的字母)</font>		
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				是否显示:			</td>
			<td>
				 <input name="is_show" id="is_show1" type="radio" value="0" <%if(is_show.equals("0"))out.print("checked");%>/>显示
				 <input name="is_show" id="is_show2" type="radio" value="1" <%if(is_show.equals("1"))out.print("checked");%>/>不显示
				</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				所属平台:			</td>
			<td>
				 <input name="is_platform" id="is_platform1" type="radio" value="0" <%if(is_platform.equals("0"))out.print("checked");%>/>自营品牌
				 <input name="is_platform" id="is_platform2" type="radio" value="1" <%if(is_platform.equals("1"))out.print("checked");%>/>会员品牌
				</td>
		</tr>
			
			
		   		
		<tr>
			<td align="right" width="10%">
				品牌描述:			</td>
			<td>
		  <textarea name="content"><%=content%></textarea>
			<script type="text/javascript" src="/program/plugins/ckeditor/ckeditor.js"></script>
			<script type="text/javascript">
				CKEDITOR.replace('content');
			</script>

				
				</td>
		</tr>
	
			
			
				
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="jumpurl" value="<%=para%>" />
				<input type="hidden" name="bpm_id" value="2274" />
				<input name="info_id" id="info_id" type="hidden" value="<%=info_id%>"/>
				<input type="button" class="buttoncss"  name="tradeSub" value="提交" onclick="subForm()"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
